package com.dr.springboot.starter.VO;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.util.Date;

/**
 * Created by rui on 2018/7/25.
 */
@Data
public class UserVO {

    private String userName;

    //    todo annotation json 在json转换的时候忽略
    @JsonIgnore
    private String password;

    //    todo annotation json 对转换的字段名进行转换
    @JsonProperty(value = "Address")
    private String address;

    // todo annotation json 在不为空的包含
    @JsonInclude(Include.NON_NULL)
//    todo annotation json 对转换的字段进行格式化
    @JsonFormat(pattern = "yyyy-MM-dd", locale = "zh")
    private Date birthday;
}
